n = int(input())
num = []
count = []
for i in range(n):
    num.append(input().split())


def Xx(xy):
    xy0 = xy
    try:
        num.index(xy0)
        return True
    except:
        return False


def Index(x, y):
    xy0 = [str(x - 1), str(y)]
    xy1 = [str(x + 1), str(y)]
    xy2 = [str(x), str(y + 1)]
    xy3 = [str(x), str(y - 1)]

    try:
        num.index(xy0)
        num.index(xy1)
        num.index(xy2)
        num.index(xy3)
        return True
    except:
        return False


def In(x, y):
    f = 0
    xy0 = [str(x - 1), str(y - 1)]
    xy1 = [str(x + 1), str(y + 1)]
    xy2 = [str(x + 1), str(y - 1)]
    xy3 = [str(x - 1), str(y + 1)]

    if Xx(xy0) == True:
        f += 1
    if Xx(xy1) == True:
        f += 1
    if Xx(xy2) == True:
        f += 1
    if Xx(xy3) == True:
        f += 1
    return f


for i in range(n):
    x = int(num[i][0])
    y = int(num[i][1])
    if Index(x, y) == True:
        count.append(num[i])

put = [[0], [0], [0], [0], [0]]
for i in range(int(len(count))):
    x = int(count[i][0])
    y = int(count[i][1])
    fen = In(x, y)
    put[fen][0] += 1

for i in put:
    print(i[0])